package com.mapull.example.section1;

/**
 * 字符串比较忽略大小写
 *
 * @author mapull
 * @date 2021-08-24
 * @since 1.0
 **/
public class StringCompareIgnoreCase {

    public static void main(String[] args) {
        System.out.println("Hello".compareTo("hello"));// -32
        System.out.println("Hello".compareToIgnoreCase("hello")); // 0
        System.out.println("Hello".compareToIgnoreCase("frank")); // 2
        System.out.println("Hello".compareToIgnoreCase("frank")); // 2
        System.out.println("Hello".compareToIgnoreCase("Icy")); // -1
        System.out.println("Hello".compareToIgnoreCase(null)); //java.lang.NullPointerException
    }
}
